# !/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
===========================
@Time : 2022/10/10 0010 23:48
@Author : 测试开发工程师
@File : index_page.py
@Software: PyCharm
============================
"""

from selenium.webdriver.common.by import By
from last_testweb.Litemall_Project.page_objects.base_page import BasePage


class IndexPage(BasePage):
    _MENU_PRODUCT_MANGE = (By.XPATH, "//*[contains(text(),'商品管理')]")
    _MENU_PRODUCT_GROUNDING = (By.XPATH, "//*[contains(text(),'商品上架')]")

    def go_to_product_grounding(self):
        from last_testweb.Litemall_Project.page_objects.goods_grounding_page import GoodsGroundingPage
        # 点击 [商品管理] 菜单
        self.do_click(*self._MENU_PRODUCT_MANGE)
        # 点击 [商品上架] 菜单
        self.do_click(*self._MENU_PRODUCT_GROUNDING)

        return GoodsGroundingPage(self.driver)
